<!doctype html>
<html>
<head>
    <include file="public/head"/>
    <title>插件钉钉首页</title>
    <meta name="description" content="插件钉钉首页">
    <meta name="keywords" content="插件钉钉首页">
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a>插件钉钉场景后台</a></li>
        <li><a href="{:cmf_plugin_url('dingding://AdminSense/Add')}">添加场景</a></li>
    </ul>
    <div class="common-form">
        <div class="well">

            <p>
                <b>当前登录管理员id:</b>{$admin_id|default='管理员未登录'}
            </p>
            <p>
                <b>插件根目录:</b>__PLUGIN_ROOT__
            </p>
            <p>
                <b>插件模板根目录:</b>__PLUGIN_TMPL__
            </p>

        </div>
        <form method="post" class="js-ajax-form" action="#">
            <div class="table_list">
                <table width="100%" class="table table-hover">
                    <thead>
                    <tr>
                        <th width="50">ID</th>
                        <th>场景</th>
                        <th>场景名称</th>
                        <th>审批单CODE</th>
                        <th>corp</th>
                        <th>app</th>
                        <th>状态</th>
                        <th width="210">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <foreach name="apps" item="vo">
                        <tr>
                            <td>{$vo.id}</td>
                            <td>{$vo.sense}</td>
                            <td>{$vo.sensename}</td>
                            <td>{$vo.procode}</td>
                            <td>{$vo.corp}</td>
                            <td>{$vo.app}</td>
                            <td>
                                <if condition="$vo['status'] eq 1">
                                    <span class="label label-success">已启用</span>
                                    <else />
                                    <span class="label label-danger">已禁用</span>
                                </if>
                            </td>
                            <td>
                                <if condition="$vo['status'] eq 1">
                                    <a class="btn btn-xs btn-warning js-ajax-dialog-btn"
                                       href="{:cmf_plugin_url('dingding://AdminSense/upStatus',['id'=>$vo['id'],'status'=>0])}">禁用</a>
                                    <else/>
                                    <a class="btn btn-xs btn-success js-ajax-dialog-btn"
                                       href="{:cmf_plugin_url('dingding://AdminSense/upStatus',['id'=>$vo['id'] ,'status'=>1])}">启用</a>
                                </if>
                                <a class="btn btn-xs btn-primary" href="{:cmf_plugin_url('dingding://AdminSense/Edit',array('id'=>$vo['id']))}">{:lang('EDIT')}</a>

                                <a class="btn btn-xs btn-primary" href="{:cmf_plugin_url('dingding://AdminSense/fieldsetting',array('id'=>$vo['id']))}">字段设置</a>
                                <a class="btn btn-xs btn-danger js-ajax-delete" class="" href="{:cmf_plugin_url('dingding://AdminSense/Delete',array('id'=>$vo['id']))}">{:lang('DELETE')}</a>
                            </td>
                        </tr>
                    </foreach>
                    </tbody>
                </table>
            </div>
        </form>
    </div>
</div>
<include file="public/scripts"/>
</body>
</html>